import { reqGetBannerList } from "@/apis/home";
import { ref, onMounted } from "vue";
export const useBanner = () => {
  //用户储存轮播图数据的数组
  let bannerList = ref([]);
  onMounted(() => {
    getBannerList();
  });
  //获取轮播图数据
  const getBannerList = async () => {
    let res = await reqGetBannerList({ distributionSite: "2" });
    // console.log(res);
    bannerList.value = res.result;
  };
  return {
    bannerList,
  };
};
